Fix xm vcpu-set command for when wrong number of VCPU is given
authorEwan Mellor <ewan@xensource.com>
Mon, 26 Feb 2007 15:41:35 +0000 (15:41 +0000)
committerEwan Mellor <ewan@xensource.com>
Mon, 26 Feb 2007 15:41:35 +0000 (15:41 +0000)
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
tools/python/xen/xend/XendDomainInfo.py

index 69e1cda45d9d089a836a7c7a97d4b7e38732022b..259898bdfdb0780b2ed93d6302dbecac9e080f31 100644 (file)
@@ -938,6 +938,9 @@ class XendDomainInfo:
         return self.info['vcpus_number']
 
     def setVCpuCount(self, vcpus):
+        if vcpus <= 0:
+            raise XendError('Invalid VCPUs')
+        
         self.info['vcpu_avail'] = (1 << vcpus) - 1
         if self.domid >= 0:
             self.storeVm('vcpu_avail', self.info['vcpu_avail'])